package com.jd.mysql.mgr.service.impl;

import java.util.List;

import com.jd.mysql.mgr.dao.MgrAccountDAO;
import com.jd.mysql.mgr.dao.MgrAccountGroupDAO;
import com.jd.mysql.mgr.pojo.MgrAccount;
import com.jd.mysql.mgr.pojo.MgrAccountGroup;
import com.jd.mysql.mgr.service.IMgrAccountService;

public class MgrAccountService implements IMgrAccountService {
	public MgrAccountDAO mgrAccountDAO;
	public MgrAccountGroupDAO mgrAccountGroupDAO;
	
	
	public void setMgrAccountGroupDAO(MgrAccountGroupDAO mgrAccountGroupDAO) {
		this.mgrAccountGroupDAO = mgrAccountGroupDAO;
	}

	public void setMgrAccountDAO(MgrAccountDAO mgrAccountDAO) {
		this.mgrAccountDAO = mgrAccountDAO;
	}
	/**
	 * @deprecated
	 */
	public boolean login(String username, String password,String ip) {
		// TODO Auto-generated method stub
		return false;
	}

	public void addAccount(MgrAccount mgraccount) {
		// TODO Auto-generated method stub
		mgrAccountDAO.saveMgrAccount(mgraccount);
	}

	public void deleteAccount(MgrAccount mgraccount) {
		// TODO Auto-generated method stub
		mgrAccountDAO.deleteMgrAccount(mgraccount);
	}

	public MgrAccount findMgrAccountById(Integer id) {
		// TODO Auto-generated method stub
		return mgrAccountDAO.findMgrAccountById(id);
	}
	
	@Deprecated
	public List<MgrAccount> getAccountList(){
		return null;
	}

	public List<MgrAccount> getAccountList(Integer start, Integer limit,Integer groupId) {
		// TODO Auto-generated method stub
		return mgrAccountDAO.getAccountList(start, limit,groupId);
	}

	public MgrAccount findMgrAccountByUserName(String username) {
		// TODO Auto-generated method stub
		return mgrAccountDAO.findMgrAccountByUserName(username);
	}

	public MgrAccount findMgrAccountByUsernameAndPassword(String username,
			String password) {
		// TODO Auto-generated method stub
		return mgrAccountDAO.findMgrAccountByUsernameAndPassword(username, password);
	}

	public void updateMgrAccount(MgrAccount mgraccount) {
		// TODO Auto-generated method stub
		mgrAccountDAO.updateMgrAccount(mgraccount);
	}

	public List<MgrAccountGroup> getMgrAccountGroupList() {
		// TODO Auto-generated method stub
		return mgrAccountGroupDAO.getMgrAccountGroupList();
	}

	public void deleteMgrAccountGroup(MgrAccountGroup mgra) {
		// TODO Auto-generated method stub
		mgrAccountGroupDAO.deleteMgrAccountGroup(mgra);
	}

	public MgrAccountGroup findMgrAccountGroupByGroupName(String groupName) {
		// TODO Auto-generated method stub
		return mgrAccountGroupDAO.findMgrAccountGroupByGroupName(groupName);
	}

	public MgrAccountGroup findMgrAccountGroupById(Integer id) {
		// TODO Auto-generated method stub
		return mgrAccountGroupDAO.findMgrAccountGroupById(id);
	}

	public void saveMgrAccountGroup(MgrAccountGroup mgra) {
		// TODO Auto-generated method stub
		mgrAccountGroupDAO.saveMgrAccountGroup(mgra);
	}

	public void updateMgrAccountGroup(MgrAccountGroup mgra) {
		// TODO Auto-generated method stub
		mgrAccountGroupDAO.updateMgrAccountGroup(mgra);
	}

	public Long getAccountTotalCount(Integer groupId,Boolean enable) {
		// TODO Auto-generated method stub
		return mgrAccountDAO.getAccountTotalCount(groupId,enable);
	}
}
